/**
 * 存储 localStorage
 */
export const setItem = (key, value) => {
    if (!key) return;
    if (typeof value !== 'string') {
        value = JSON.stringify(value);
    }
    window.localStorage.setItem(key, value);
};

/**
 * 获取 localStorage
 */
export const getItem = key => {
    if (!key) return;
    return window.localStorage.getItem(key);
};

/**
 * 删除 localStorage
 */
export const removeStore = key => {
    if (!key) return;
    window.localStorage.removeItem(key);
};
